<?php
$xml = simplexml_load_file("books.xml");		// load 

foreach ($xml->book[2]->children() as $childName => $value) {		// children() a single node only 
	echo "$childName : $value \n";
}

echo "\n############################\n";

$author = $xml->xpath("/bookstore/book/author");				// xpath travse all node.
foreach ($author as $key => $value) {
	echo "$key : $value \n";
}